﻿using PowerHub.MES.Entities;
using PowerHub.MES.Entities.Production;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PowerHub.MES.DTO.Production.DTO
{
    public class Production_WorkOrderProductionTaskDTO 
    {

        /// <summary>
        /// 工单id
        /// </summary>
        public string? Id { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        public string? WorkOrderNO { get; set; }

        /// <summary>
        /// 工单名称
        /// </summary>
        public string? WorkOrderName { get; set; }


        public List<Production_WorkOrderTask> production_WorkOrderTasks { get; set; }

        /// <summary>
        /// 订单数量
        /// </summary>
        public int? OrderQuantity { get; set; } 

    }

    public class Production_WorkOrderTask
    {
        public string? MaterialsName { get; set; }
        public int? Quantity { get; set; }
        public int? AllocatedQuantity { get; set; }=0;

        /// <summary>
        /// 原料id
        /// </summary>
        public string? MaterialId { get; set; }
        /// <summary>
        /// 工单BOM_id
        /// </summary>
        public string? BillOfMaterialId { get; set; }

        public Production_WorkOrderTask(string? materialId, string? billOfMaterialId, string? materialsName, int? quantity, int? allocatedQuantity)
        {
            MaterialId = materialId;
            BillOfMaterialId = billOfMaterialId;
            MaterialsName = materialsName;
            Quantity = quantity;
            AllocatedQuantity = allocatedQuantity;
        }
    }
}
